<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>De Bello Gallico</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../flashcard.css" rel="stylesheet" type="text/css">
</head>


<script type="text/javascript">
var sentences = [
  [ ["Ea", "res", "est", "Helvetiis", "per", "indicium", "enuntiata."],
    ["That", "thing", "is", "to-Helvetii", "by", "informers", "having-been-announced."] ],
  [ ["Moribus", "suis", "Orgetorigem", "ex", "vinclis", "causam", "dicere", "coegerunt."],
    ["By-customs", "their-own", "Orgetorix", "out-of", "chains", "[his]_case", "to-plead", "they-compelled."] ],
  [ ["Damnatum", "poenam", "sequi", "oportebat", "ut", "igni", "cremaretur."],
    ["[him]_having-been-condemned", "[the]-punishment", "to-follow", "it-was-needful", "that", "by-fire", "he-should-be-burned."] ],
  [ ["Die", "constituta", "causae", "dictionis", "Orgetorix", "ad", "iudicium", "omnem", "suam", "familiam,"],
    ["On-the-day", "appointed", "of-[the]-case", "of-the-pleading", "Orgetorix", "near", "place-of-trial", "all", "his-own", "retainers,"] ],
  [ ["ad", "hominum", "milia", "decem,", "undique", "coegit", "et", "omnes", "clientes", "obaeratosque", "suos,"],
    ["to", "of-men", "thousands", "ten,", "from-all-sides", "collected", "and", "all", "dependants", "debtors-also", "his-own,"] ],
  [ ["quorum", "magnum", "numerum", "habebat,", "eodem", "conduxit:"],
    ["of-whom", "great", "number", "he-had,", "to-that-same_[place]", "together-led:"] ],
  [ ["per", "eos,", "ne", "causam", "diceret,", "se", "eripuit."],
    ["by-means-of", "those,", "that-not", "case", "he-should-plead,", "himself", "he-off-took-hastily."] ],
  [ ["Cum", "civitas", "ob", "eam", "rem", "incitata", "armis", "ius", "suum", "exsequi", "conaretur,"],
    ["When", "[the]_state", "on-account-of", "that", "thing", "excited", "by-arms", "right", "its-own", "out-to-follow", "was-attempting,"] ],
  [ ["multitudinemque", "hominum", "ex", "agris", "magistratus", "cogerent,", "Orgetorix", "mortuus est;"],
    ["[a]-multitude-also", "of-men", "out-of", "fields", "[the]-magistrates", "were-driving-together,", "Orgetorix", "died;"] ],
  [ ["neque", "abest", "suspicio,", "ut", "Helvetii", "arbitrantur,", "quin", "ipse", "sibi", "mortem", "consciverit."],
    ["neither", "away-is", "suspicion,", "as", "Helvetii", "think,", "but-that", "himself", "to-himself", "death", "may-have-decreed."] ]
];

var i = 0;
var j = 0;

var shown = 0;

function updateVoc() {
	
	var sentence = "";
	
	for(n = 0; n < sentences[i][0].length; n++) {
		if (n == j) {
			sentence += ' <span class="curword">' + sentences[i][0][n] + "</span>";
		} else {
			sentence += " " + sentences[i][0][n];
		}
	}
	
	document.getElementById('v3').innerHTML = sentence;
	
	if (shown == 0) {
		document.getElementById('v1').innerHTML = "";
	} else {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
	}
}

function next() {
	shown++;
	if (shown > 1) {
		shown = 0;
		j++;
		if (j >= sentences[i][0].length) {
			j = 0;
			i++;
			if (i >= sentences.length) {
				i = 0;
				alert('All done!');
			}
		}
	}
	updateVoc();
}

function prev() {
	shown--;
	if (shown < 0) {
		shown = 1;
		j--;
		
		if (j < 0) {
			i--;
			if (i < 0) {
				i = sentences.length - 1;
				alert('All done!');
			}
			j = sentences[i][0].length - 1;
		}
	}
	
	updateVoc();
}

</script>

<body onload="updateVoc()">
<h1 style="text-align:center; color: #60B0C0;">Liber I - Caput IV</h1>

<div class="center">
<div id="v3" class="v3"></div>
<div id="v2" class="v2">&nbsp;</div>
<div id="v1" class="v1"></div>


<a href="#" class="button" id="btnprev" onclick="prev()" accesskey="p">&lt;&lt;</a>
<a href="#" class="button" id="btnnext" onclick="next()" accesskey="n">&gt;&gt;</a>


</div>
</body>
</html>
